package com.example.liteflow.bol;

import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeBooleanComponent;
import lombok.extern.slf4j.Slf4j;

/**
 * @author chen.an
 * @date 2024-08-20 20:49
 */
@Slf4j
@LiteflowComponent(id = "BreakNode", name = "判断（idx = 3 退出）")
public class BreakNode extends NodeBooleanComponent {
    @Override
    public boolean processBoolean() throws Exception {
        int loopIndex = this.getLoopIndex();
        log.info("BreakNode 节点组件【{}】-BooleanNode,下标idx：{}", Thread.currentThread().threadId(), loopIndex);
        return loopIndex == 3;
    }
}
